package com.nlelpct.manage.enums;

public enum SysAuthenticationTypeEnum {

    INSERT("登录", 0),

    UPDATE("认证", 1);



    private final String name;
    private final Integer index;


    SysAuthenticationTypeEnum(String name, Integer index) {
        this.name = name;
        this.index = index;
    }

    public static String getName(Integer index) {
        for (SysAuthenticationTypeEnum value : SysAuthenticationTypeEnum.values()) {
            if (value.getIndex().equals(index)) {
                return value.name;
            }
        }
        return null;
    }

    public static Integer getIndex(String name) {
        for (SysAuthenticationTypeEnum value : SysAuthenticationTypeEnum.values()) {
            if (value.getName().equals(name)) {
                return value.index;
            }
        }
        return null;
    }

    public Integer getIndex() {
        return index;
    }

    public String getName() {
        return name;
    }
}
